package com.kbook.vo.extractor;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.ResultSetExtractor;

import com.kbook.vo.Category;
import com.kbook.vo.pack.CategoryPackage;
import com.kbook.vo.pack.PackageInterface;

public abstract class BaseExtractor implements ResultSetExtractor {

	protected PackageInterface packageImpl;
	
	public List extractData(ResultSet arg0) throws SQLException,
			DataAccessException {
		// TODO Auto-generated method stub
		List resultList = new ArrayList();
		initPackageImpl();
		while(arg0.next()){
			resultList.add(packageImpl.packageData(arg0));
		}
		return resultList;
	}

	public PackageInterface getPackageImpl() {
		return packageImpl;
	}

	public abstract void initPackageImpl();
}
